Appendix

In [5]:
from Part3 import * 
In [6]:
def plotOutput(name):
    img1 =Image.open("Images/"+name+".jpg").convert('L')
    median_blurred = img1.filter(ImageFilter.MedianFilter(size=3))
    not_blurred = np.array(img1)
    pix1 = np.array(median_blurred)
    patches1 = getPatches(pix1, window_shape, step_length)
    img1_pixel_ratios = getPixelRatios(pix1, bin_number).reshape((-1,))
    patch1_pixel_ratios = getPixelRatios(patches1, bin_number)
    image1_bin_limits = calculateBinLimits(patch1_pixel_ratios)
    plotXBarChart(patch1_pixel_ratios, image1_bin_limits)
    outliers = getOutlierPatchIndices(patch1_pixel_ratios, image1_bin_limits, window_shape, step_length,bin_number)
    fillOutliers(not_blurred, outliers, window_shape, step_length)

Fabric 1 Outputs

In [7]:
plotOutput("Fabric1")

Fabric 2 Outputs

In [8]:
plotOutput("Fabric2")

Fabric 3 Outputs

In [9]:
plotOutput("Fabric3")

Fabric 4 Outputs

In [10]:
plotOutput("Fabric4")

Fabric 5 Outputs

In [11]:
plotOutput("Fabric5")

Fabric 6 Outputs

In [12]:
plotOutput("Fabric6")

Fabric 7 Outputs

In [13]:
plotOutput("Fabric7")

Fabric 8 Outputs

In [14]:
plotOutput("Fabric8")

Fabric 9 Outputs

In [15]:
plotOutput("Fabric9")

Fabric 10 Outputs

In [16]:
plotOutput("Fabric10")

Fabric 11 Outputs

In [17]:
plotOutput("Fabric11")

Fabric 12 Outputs

In [18]:
plotOutput("Fabric12")

Fabric 13 Outputs

In [19]:
plotOutput("Fabric13")

Fabric 14 Outputs

In [20]:
plotOutput("Fabric14")

Fabric 15 Outputs

In [21]:
plotOutput("Fabric15")

Fabric 16 Outputs

In [22]:
plotOutput("Fabric16")

Fabric 17 Outputs

In [23]:
plotOutput("Fabric17")

Fabric 18 Outputs

In [24]:
plotOutput("Fabric18")

Fabric 19 Outputs

In [25]:
plotOutput("Fabric19")

Fabric 20 Outputs

In [26]:
plotOutput("Fabric20")
In [ ]: